package com.zdsoft.blp.zongbuju.wode.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.widget.TextView;

import com.zdsoft.blp.R;
import com.zdsoft.blp.gongyong.fanhui.FanHuiView;
import com.zdsoft.blp.gongyong.net.BaseActivity;

/**
 * Created by Administrator on 2016/9/1.
 */
public class WoDeXiaoQuActivity extends BaseActivity {
    private FanHuiView back;
    private TextView tv_qiehuan, tv_showshequ;
    private SharedPreferences sp;
    @Override
    protected void init() {
        setContentView(R.layout.wodexiaoqu_wode);
        back = find(R.id.back);
        tv_showshequ = find(R.id.tv_showshequ);
        tv_qiehuan = find(R.id.tv_qiehuan);
        back.getTv_title().setText("我的小区");
        sp = getSharedPreferences("info", Context.MODE_PRIVATE);
        getSheQu();
        tv_qiehuan.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(WoDeXiaoQuActivity.this, WDXuanZeSheQu.class);
                intent.putExtra("type",1);
                startActivity(intent);
            }
        });
    }

    public void getSheQu() {
        tv_showshequ.setText(sp.getString("communityName",""));
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        getSheQu();
    }
}
